<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<script type="text/javascript" src="../js/AjaxAPI.js" charset="UTF-8"></script>
	
<script type="text/javascript">
ajaxCall("get", "../Test", aa);
function aa(data){
	var objs = JSON.parse(data);
	var i=0;
	var columns=new Array();
	
	var values=new Array();
	
	
	for (obj in objs) {
		var aaa=new  Array();
		for(attr in objs[obj]){
			if(i==0){
				columns.push(attr)	
			}
			
			alert(objs[obj][attr]);
			aaa.push(objs[obj][attr])
		}
		values.push(aaa);
		i=1;
       
    }
	
	var tb = document.getElementById('t1');
	var newTr = tb.insertRow();
	
	for(tmp in columns){
		var newTd0 = newTr.insertCell();
		newTd0.innerHTML=columns[tmp];
	}
	
	for(row in values){
		var newTr1 = tb.insertRow();
		
		for(cells in values[row]){
			var newTd= newTr1.insertCell();
			newTd.innerHTML=values[row][cells];
		}
		
	}

}

</script>
<body>
<table id="t1" border="1px"></table>
</body>
</html>